Correctly parse the value set via OIDCMemCacheConnectionsTTL#1346
Merged
zandbelt merged 1 commit intoOpenIDC:masterfrom Aug 18, 2025
Merged
Correctly parse the value set via OIDCMemCacheConnectionsTTL#1346zandbelt merged 1 commit intoOpenIDC:masterfrom
zandbelt merged 1 commit intoOpenIDC:masterfrom
Conversation
Currently the value set via OIDCMemCacheConnectionsTTL is interpreted as
microseconds and not as seconds. Correctly interpret this value as seconds
via ap_timeout_parameter_parse and create the needed infrastructure to parse
similar timeout fields in the future.
* src/cache/memcache.c:
- Change type of ttl to apr_interval_time_t.
- The default value is now returned via oidc_cfg_cache_memcache_ttl_get.
- Adjust format strings for apr_interval_time_t printing.
* src/cfg/cache.c:
- Generalize OIDC_CFG_MEMBER_FUNCS_CACHE_INT_EXT macro to
OIDC_CFG_MEMBER_FUNCS_CACHE_PARSE which allows to specify the parsed
type.
- Add OIDC_CFG_MEMBER_FUNCS_CACHE_TIMEOUT macro which parses
apr_interval_time_t values via oidc_cfg_parse_timeout_min_max.
- Shorten maximum TTL via OIDC_CACHE_MEMCACHE_CONNECTIONS_TTL_MAX to 4292
seconds.
- Change default via OIDC_DEFAULT_CACHE_MEMCACHE_CONNECTIONS_TTL from 0
to 60 seconds.
- Use OIDC_CFG_MEMBER_FUNCS_CACHE_TIMEOUT instead of
OIDC_CFG_MEMBER_FUNCS_CACHE_INT macro for memcache_ttl field.
* src/cfg/cache.h:
- Change type of memcache_ttl from int to apr_interval_time_t.
* src/cfg/cfg.h:
- Define OIDC_CONFIG_POS_TIMEOUT_UNSET to -2 (-1 might be used for unlimited
timeout).
* src/cfg/cfg_int.h:
- Change type of memcache_ttl from int to apr_interval_time_t.
* src/cfg/parse.c:
- Add oidc_cfg_parse_timeout_min_max to parse a timeout string via
ap_timeout_parameter_parse into an apr_interval_time_t if it is in a valid
min/max range.
* src/cfg/parse.h:
- Add prototype for oidc_cfg_parse_timeout_min_max
Signed-off-by: Ruediger Pluem <[email protected]>
zandbelt
added a commit
that referenced
this pull request
Aug 18, 2025
Signed-off-by: Hans Zandbelt <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently the value set via OIDCMemCacheConnectionsTTL is interpreted as microseconds and not as seconds. Correctly interpret this value as seconds via ap_timeout_parameter_parse and create the needed infrastructure to parse similar timeout fields in the future.
src/cache/memcache.c:
src/cfg/cache.c:
src/cfg/cache.h:
src/cfg/cfg.h:
src/cfg/cfg_int.h:
src/cfg/parse.c:
src/cfg/parse.h: